package com.ysd.lis.controller.bac;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.bac.BacReqPurpose;
import com.ysd.lis.request.bac.PurposeDto;
import com.ysd.lis.request.bac.PurposeParam;
import com.ysd.lis.service.bac.BacReqPurposeService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author prs
 * @since 2024-04-10
 */
@RestController
@RequestMapping("/api/bac/bacReqPurpose")
public class BacReqPurposeController extends BaseController {

    @Autowired
    BacReqPurposeService bacReqPurposeService;
    @ApiOperation("查询")
    @GetMapping("/findPurposeList")
    public Result findPurposeList(PurposeParam param){
        return bacReqPurposeService.findPurposeList(param);
    }

    @ApiOperation("新增")
    @PostMapping("/addPurpose")
    public Result addPurpose(@RequestBody BacReqPurpose bacReqPurpose){
        return  bacReqPurposeService.addPurpose(bacReqPurpose);
    }

    @ApiOperation("修改")
    @PostMapping("/editPurpose")
    public Result editPurpose(@RequestBody BacReqPurpose bacReqPurpose) {
        return bacReqPurposeService.editPurpose(bacReqPurpose);
    }

    @ApiOperation("根据详情id删除详情数据")
    @PostMapping("/deletePurpose")
    public Result deletePurpose(@RequestBody BacReqPurpose bacReqPurpose) {
        return bacReqPurposeService.deletePurpose(bacReqPurpose);
    }
    @ApiOperation("批量删除")
    @PostMapping("/batchDeletePurposeList")
    public Result batchDeletePurposeList(@RequestBody PurposeDto dto){
        return  bacReqPurposeService.batchDeletePurposeList(dto);
    }
}
